<template>
  <el-menu
    :collapse="isCollapse"
    :style="{ width: isCollapse ? '64px' : '230px' }"
    active-text-color="#ffd04b"
    background-color="#545c64"
    class="aside-container"
    text-color="#fff"
    @open="handleOpen"
    @close="handleClose"
    :default-active="menuActive"
  >
    <p class="logo-lg">{{ isCollapse ? "DiDi" : "DIDI陪诊" }}</p>
    <treeMenu :index="1" :menuData="menuData"></treeMenu>
  </el-menu>
</template>

<script setup>
import treeMenu from "./treeMenu.vue";
import { useRouter } from "vue-router";
import { reactive, computed } from "vue";
import { useStore } from "vuex";
const handleOpen = () => {};
const handleClose = () => {};
const router = useRouter();

// const menuData = reactive(router.options.routes[0].children);
const store = useStore();
const menuData = computed(() => store.state.menu.routerList);
const isCollapse = computed(() => store.state.menu.isCollapse);
// 菜单高亮
const menuActive = computed(() => store.state.menu.menuActive);
</script>

<style scoped lang="less">
.aside-container {
  height: 100%;

  .logo-lg {
    font-size: 20px;
    text-align: center;
    line-height: 50px;
    height: 50px;
    color: #fff;
  }
}
</style>
